from pms.common.views import PostFormula
from technology.utils.update import update_technology_by_view
from technology.utils.profile import technology_view


class API(PostFormula):

    require_permissions = [10]

    def handle(self, req):
        tid = req['id']
        view = req['mod']
        technology = update_technology_by_view(tid, view)
        return self.success_respond(technology_view(technology))
